//
//  ShopDetailsTableViewCell.m
//  大轮胎
//
//  Created by 朱永超 on 2017/3/30.
//  Copyright © 2017年 zyc. All rights reserved.
//

#import "ShopDetailsTableViewCell.h"
#import <Masonry.h>
#import <SDWebImage/UIImageView+WebCache.h>
@implementation ShopDetailsTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self.contentView addSubview:self.jianJieImageV];
        [self.contentView addSubview:self.jianJieLabel];
        
    }
    return self;
}

-(void)setShopDeModel:(ShopDetailsModel *)shopDeModel
{
    _shopDeModel = shopDeModel;
    
    
    [self.jianJieImageV sd_setImageWithURL:[NSURL URLWithString:[[shopDeModel.img lastObject] objectForKey:@"img"]] placeholderImage:[UIImage imageNamed:@""]];
    [self.jianJieImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.contentView.mas_top).with.offset(10);
        make.left.mas_equalTo(self.contentView.mas_left).with.offset(10);
        make.right.mas_equalTo(self.contentView.mas_right).with.offset(-10);
    }];
    
    self.jianJieLabel.text = shopDeModel.concent;
    [self.jianJieLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.jianJieImageV.mas_bottom).with.offset(10);
        make.left.mas_equalTo(self.contentView.mas_left).with.offset(10);
        make.right.mas_equalTo(self.contentView.mas_right).with.offset(-10);
        make.bottom.mas_equalTo(self.contentView.mas_bottom).with.offset(-10);
    }];
    
}

-(UIImageView *)jianJieImageV
{
    if (!_jianJieImageV) {
        _jianJieImageV = [[UIImageView alloc] init];
    }
    return _jianJieImageV;
}
-(UILabel *)jianJieLabel
{
    if (!_jianJieLabel) {
        _jianJieLabel = [[UILabel alloc] init];
        _jianJieLabel.numberOfLines = 0;
    }
    return _jianJieLabel;
}

@end
